package com.ap.core.domain;

import org.hibernate.annotations.TypeDef;
import org.joda.time.LocalDate;

import javax.persistence.*;

/**
 * User: Rohit.Dixit
 */
@Entity
@Table(name = "T_DELIVERY_ADDRESS")
@AttributeOverride(name = "id",column = @Column(name = "delivery_address_id"))
@TypeDef(name = "id", typeClass = Long.class)
public class DeliveryAddress extends BaseDeliveryAddress {


	private static final long serialVersionUID = -8014739487329847L;

    @OneToOne
    @JoinColumn(name="ap_txn_id")
    private OrderPayment orderPayment;


    private DeliveryAddress(){
        super();
    }
    

    public DeliveryAddress(Long deliveryMethodId, String addressLine1, String addressLine2,
                           String addressLine3, String addressLine4, String addressLine5, String addressLine6,
                           String postCode, String countryCode, String reconciliationCycleId, LocalDate reconciliationDate) {
		 super(deliveryMethodId, addressLine1, addressLine2, addressLine3, addressLine4, addressLine5, addressLine6, postCode, countryCode, reconciliationCycleId, reconciliationDate);
	}

    public OrderPayment getOrderPayment() {
        return orderPayment;
    }

    public void setOrderPayment(OrderPayment orderPayment) {
        this.orderPayment = orderPayment;
    }
}
